<?php
namespace AuctionCore\AuctionAppApi;
/**
* 回传系统各接口 测试类
* @author       Eric Lee
*/
class AppApiTest extends \PHPUnit_Framework_TestCase {
    const DEALER_ID = '56';
    const TOKEN = 'MDAwMDAwMDAwMH2hdrGxt2OxsIdjrIKpdN2zip_asMvSY4Biap2IZaqXfX6GsbHeeaOwroSugZiBzbR9gs6ypbBjgYaYaY53spaJoZiyvaiasQ';
	public static  function testAppApi(){?>

            <meta charset='utf-8'>
            <h1>拍卖App接口测试</h1>
            <hr>
            <b>1,登录接口</b>
            <form action="/Auth/login" method="post" target="_blank"  >
            username:<input name="username" value="luxin" />               <br>
            password:<input name="passwd" type="password" value="<?=md5('123456')?>" />     <br>
            imei:    <input name="imei" type="text" value="013214008043855" />        <br>
            <input type="submit" name="submit" value="submit" />
            </form>
            <hr>
            <b>2,拍单列表</b>
            <form action="http://liguohua.appapi.lpaiche.com/Auction/get_list" method="post"  target="_blank" >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />

                <br>列表类型:<input name="type" value="" />列表类型（1:关注、2:出过价的、3:特定场次、4:首页列表）
                <br>拍单开始时间:<input name="day" value="0" />拍单开始时间（0:全部、1:今日、2:明日）
                <br>当前页码:<input name="page" value="1" />
                <br>页面大小:<input name="page_size" value="20" />
                <br>场次ID:<input name="scene_id" value="" />
                <br>主品牌ID:<input name="mbrand_id" value="" />
                <br>车系ID:<input name="series_id" value="" />
                <br>排放标准:<br><?php
                foreach(C('INT_EMISSION_STD') as $k=>$v){
                        echo '<input type="checkbox" name="emission[]" value="'.$k.'" />'.$v;
                    }
                ?>（多选）
                <br>推荐价格区间:<br><?php
                foreach(C('INT_PRICE_RANGE') as $k=>$v){
                    echo '<input type="checkbox" name="prices_interval[]" value="'.$k.'" />'.$v;
                }
                ?>（多选）
                <br>自定义最低价:<input name="custom_low_price" value="" />
                <br>自定义最高价:<input name="custom_high_price" value="" />
                <br>年限:<br><?php
                    foreach(C('INT_AGE_RANGE') as $k=>$v){
                        echo '<input type="checkbox" name="year_interval[]" value="'.$k.'" />'.$v;
                    }
                ?>（多选）
                <br>车况等级:<br><?php
                    foreach(C('INT_CAR_LEVEL') as $key=>$val){
                        if($key=='1')continue;
                        foreach(C('INT_COM_STATE') as $k=>$v){
                            if($k=='1')continue;
                            echo '<input type="checkbox" name="condition_level[]" value="'.$k.$key.'" />'.$v.$val;
                        }
                        echo '<br>';
                    }
                ?>（多选）
                <br><input type="submit" name="submit" value="submit" />
            </form>
            <hr>
            <b>3,投标出价</b>
            <form action="http://liguohua.appapi.lpaiche.com/AuOrder/bid" method="post" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>拍单ID:<input name="order_id" value="" />
                <br>出价:<input name="price" value="" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <hr>
            <b>4,竞标出价</b>
            <form action="http://liguohua.appapi.lpaiche.com/AuOrder/bidding" method="post" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>拍单ID:<input name="order_id" value="" />
                <br>基价:<input name="price" value="" />
                <br>出价:<input name="add_price" value="" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <hr>
            <b>5,竞标出价记录</b>
            <form action="http://liguohua.appapi.lpaiche.com/AuOrder/get_bidding_price_log" method="post" target="_blank"  >
                <br>车商ID:<input name="uid" value="<?=self::DEALER_ID?>" />
                <br>拍单ID:<input name="order_id" value="" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <hr>
            <b>6,我出价的拍单列表</b>
            <form action="http://liguohua.appapi.lpaiche.com/Trade/bid_price_list" method="post" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>当前页:<input name="page" value="1" />
                <br>页面大小:<input name="page_size" value="20" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <b>7,代金券列表</b>
            <form action="http://liguohua.appapi.lpaiche.com/Asset/coupon" method="post" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>使用情况:<input name="type" value="1" />(1：可使用，2：已使用，3：已过期)
                <br>当前页:<input name="page" value="1" />
                <br>页面大小:<input name="page_size" value="20" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <b>8,使用代金券</b>
            <form action="http://liguohua.appapi.lpaiche.com/Asset/use_coupon" method="post" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>拍单ID:<input name="order_id" value="" />
                <br>代金券ID: <?php
                $res = M('dealer_coupon')->where("dealer_id='".self::DEALER_ID."' and use_status=0  and end_date>='".date('Y-m-d')."'")->select();
                foreach($res as $val){
                    echo '<input type="checkbox" name="coupon_ids[]" value="'.$val['coupon_id'].'" />'.$val['coupon_no'].' ';
                }
                ?><br>
                <input type="submit" name="submit" value="submit" />
            </form>

            <b>9,软件更新</b>
            <form action="http://liguohua.appapi.lpaiche.com/Upgrade" method="post" target="_blank"  >
                <br>应用类型:<input name="sort" value="1" />
                <br>应用设备:<input name="driver" value="1" />
                <br>版本号:<input name="version" value="1.1.1" />
                <input type="submit" name="submit" value="submit" />
            </form>

            <b>10,投标、等待竞标、竞标、成效待确认、流拍</b>
            <form action="http://liguohua.appapi.lpaiche.com/Order/detail" method="get" target="_blank"  >
                <br>车商ID:<input name="dealer_id" value="<?=self::DEALER_ID?>" />
                <br>拍单ID:<input name="order_id" value="" />
                <input type="submit" name="submit" value="submit" />
            </form>



    <?php
    }
}